<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "wanka";

// 创建连接
$db = new mysqli($servername, $username, '', $dbname);
// 检测连接


$pass = $_POST['pass'];
$ph = $_POST['phone'];

$sql = 'select * from person where phone= '.$ph;
	if($query = mysqli_query($db, $sql)){
		$rowcount = mysqli_num_rows($query);
		if($rowcount>0){
			echo '此号已被注册';
		
		}else{
			$sqw = "INSERT INTO person (psw,phone)  VALUES ('$pass','$ph')";
			$query = mysqli_query($db, $sqw);
    			echo "注册成功";

	};
	};



$db->close();
?>